HAL SDRAM migration: List of applicable concepts ¶
This section provides information about the HAL SDRAM applicable architecture concepts.
Concepts for SDRAM ¶
|
Concept |
Description |
|---|---|
|
The initialization has been split into separate init and config functions:
|
|
|
Removal and conversion of init structure to configuration structure |
The init structure
|
|
The handle structure
|
|
|
The init structure
|
|
|
The
|
|
|
Two functions to set and get user data are available:
|
|
|
Individual callback registration APIs replace global register and unregister functions |
The callback registration is handled by specific functions for each SDRAM event. These functions are used to register callback functions for different SDRAM events. |
|
The SDRAM state machine is reworked to ensure transitions of the peripheral functional states. |
|
|
The SDRAM functions were updated to return:
|
|
|
Redesign the HAL error-handling mechanisms to enhance error detection, reporting, and management.. |
|
|
All TypeDef parts of the HAL SDRAM driver have been removed and replaced by
|
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
The
|
|
|
Add HAL PPP Services for Drivers with Handle to Retrieve Corresponding Peripheral Clock Frequency. |
HAL SDRAM provides new API to retrieve clock frequency
|
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including SDRAM instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
|
Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions). |
All HAL SDRAM functions start with
|
|
Introduce a conditional compilation flag
|
|
|
Add ASSERT_DBG_STATE macro controlled by USE_ASSERT_DBG_STATE conditional. |
Introduce a conditional compilation flag
|
Other HAL SDRAM changes ¶
|
Concept |
Consideration |
|---|---|
|
Split the configuration structure into Common configuration structure, Memory configuration structure. |
The configuration has been split into:
|
|
Provide new APIs to set the configurations |
The configurations are set using:
|
|
Remove WriteOperation from SDRAM configuration structure. |
By default, the write protection is enabled, no initial configuration. |
|
Remove process APIs as they depends of user application. |
There is no specific FMC hardware configuration needed, as read and write operations are directly accessible by the user. |
|
Change timing parameters unit from cycle to ms. |
The static API is added to convert these values before setting them in the FMC register. |
|
Change the resources accessed from Core to HAL. |
The only interface with user is
|
|
Revise the send command APIs. |
The send command APIs and services are redesigned to use command-specific structures containing only the command and its required parameter. |
|
Use the SDRAM device as explicit input parameter in the dedicated APIs instead of configuring it inside the configuration structure. |
In HAL2, the user selects the SDRAM device directly as a target parameter in the dedicated APIs (e.g. configuration, send command), rather than specifying it as a filed within the configuration structure. |